using MicroMsg.Manager;
using MicroMsg.Resource.@string;
using MicroMsg.UI.UserContrl;
using MicroMsg.UI.Util;
using System;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
namespace MicroMsg.UI.Page
{
	public class LocationServiceTipPage : BasePage
	{
		private const string TAG = "LocationServiceTipPage";
		public const string bNotShowLbsTipKey = "bNotShowDialogInLbs";
		public const string bAgreeToUseLbsKey = "bAgreeToUseLbsKey";
		private object[] passData;
		private string forwardUrl;
		internal Grid LayoutRoot;
		internal TextBlock txtTitle;
		internal RichTextBox txtContent;
		internal Paragraph sParagraph;
		internal Button btnLeft;
		internal Button btnRight;
		private bool _contentLoaded;
		public LocationServiceTipPage()
		{
			this.InitializeComponent();
			this.InitUI();
		}
		private void InitUI()
		{
			this.LayoutRoot.set_Background(R.theme.COMMON_APPBAR_BK_BRUSH);
			this.txtTitle.set_Text(strings.LBS_PrivacyTitle);
			this.btnLeft.set_Content(strings.COM_Confirm);
			this.btnRight.set_Content(strings.COM_Cancel);
			this.sParagraph.get_Inlines().Clear();
			Run run = new Run();
			Run run2 = new Run();
			Hyperlink privacyLinkButton = SeePrivacyCtrl.GetPrivacyLinkButton(R.theme.DIALOG_TITLE_FONT_BRUSH);
			Hyperlink microsoftPrivacyLink = SeePrivacyCtrl.GetMicrosoftPrivacyLink(R.theme.DIALOG_TITLE_FONT_BRUSH);
			Run run3 = new Run();
			run.set_Text(strings.LBS_PrivacyTip1);
			run.set_FontSize(20.0);
			run2.set_Text(strings.LBS_PrivacyTip2);
			run2.set_FontSize(20.0);
			if (R.isEnglish())
			{
				run3.set_Text(".");
			}
			else
			{
				run3.set_Text("。");
			}
			this.sParagraph.get_Inlines().Add(run);
			this.sParagraph.get_Inlines().Add(privacyLinkButton);
			this.sParagraph.get_Inlines().Add(run2);
			this.sParagraph.get_Inlines().Add(microsoftPrivacyLink);
			this.sParagraph.get_Inlines().Add(run3);
		}
		private void hl_Click(object sender, RoutedEventArgs e)
		{
			string strUrl;
			if (R.isChineseCN())
			{
				strUrl = "http://www.microsoft.com/windowsphone/zh-cn/privacy.aspx";
			}
			else
			{
				strUrl = "http://www.microsoft.com/windowsphone/en-us/privacy.aspx";
			}
			ToolFunction.GotoWebLink(strUrl);
		}
		protected override void OnPageIn(object[] object_0)
		{
			if (object_0 != null && Enumerable.Count<object>(object_0) == 2)
			{
				this.passData = (object_0[0] as object[]);
				this.forwardUrl = (object_0[1] as string);
			}
		}
		private void btnLeft_Click(object sender, RoutedEventArgs e)
		{
			ConfigMgr.setBool("bNotShowDialogInLbs", true);
			ConfigMgr.setBool("bAgreeToUseLbsKey", true);
			ToolFunction.GotoPageForUserControl(this.forwardUrl, this.passData, true);
		}
		private void btnRight_Click(object sender, RoutedEventArgs e)
		{
			ConfigMgr.setBool("bNotShowDialogInLbs", false);
			base.GoBack();
		}
		private void checkBoxNoShwoAgain_Click(object sender, RoutedEventArgs e)
		{
		}
		public static void GotoThisPage(object[] pData)
		{
			if (!ConfigMgr.getBool("bNotShowDialogInLbs", false))
			{
				ToolFunction.GotoPageForUserControl("/Source/UI/Util/LocationServiceTipPage.xaml", pData, false);
				return;
			}
			object[] object_ = pData[0] as object[];
			string string_ = pData[1] as string;
			ToolFunction.GotoPageForUserControl(string_, object_, false);
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/UI/Util/LocationServiceTipPage.xaml", 2));
			this.LayoutRoot = (Grid)base.FindName("LayoutRoot");
			this.txtTitle = (TextBlock)base.FindName("txtTitle");
			this.txtContent = (RichTextBox)base.FindName("txtContent");
			this.sParagraph = (Paragraph)base.FindName("sParagraph");
			this.btnLeft = (Button)base.FindName("btnLeft");
			this.btnRight = (Button)base.FindName("btnRight");
		}
	}
}
